import requests
from django.contrib.auth import authenticate

# url = "http://127.0.0.1:8000/admin/"
# # 默认可以重定向  allow_redirects=True
# # 所以返回的是重定向后的登录界面
# response = requests.get(url)
# print(response.text)



# url = "http://127.0.0.1:8000/admin/"
# response = requests.get(url,allow_redirects=False)
#
#
# print(response.status_code)
#
# location = response.headers.get('location')
# location = f'http://127.0.0.1:8000{location}'
# response = requests.get(location)
# print(response.status_code)
# print(response.text)



# url = "http://127.0.0.1:8000/admin/"
# headers = {
#     # 携带cookie
#     # 'cookie':'sessionid=ttl8ntmuswx8feft412htfmfvl9i8xm6'
# }
# cookies = {
# 'sessionid':'ttl8ntmuswx8feft412htfmfvl9i8xm6'
# }
# response = requests.get(url,headers=headers,cookies=cookies)
# print(response.status_code)
# print(response.text)

















